<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:composition template="template.xhtml">
	<ui:define name="content">

	<br />
	<p:fieldset legend="#{friendBean.pack.name}">  
	    <h:panelGrid columns="2" cellpadding="10">  
	        <p:graphicImage width="200px" value="images/packages/#{friendBean.pack.id}.jpg" />  
	        <h:outputText value="#{friendBean.pack.description}" />  
	    </h:panelGrid>  
	    
        
        <p:tabView>
        	<p:tab title="La località">
        		<h2><h:outputText value="#{friendBean.pack.location.name} (#{friendBean.pack.location.nation.name})" /></h2>
        		<h:outputText value="#{friendBean.pack.location.description}" />
        	</p:tab>
        	<p:tab title="Hotel selezionato">
        		<h:panelGrid columns="2" cellpadding="10"> 
        			<p:graphicImage width="300px" value="images/hotels/#{friendBean.pack.hotel.id}.jpg" /> 
				    <h:panelGrid columns="1">
				        <h2><h:outputText value="#{friendBean.pack.hotel.name}" /></h2>
	        			<h:outputText value="#{friendBean.pack.hotel.description}" />
        			</h:panelGrid>  
			    </h:panelGrid>
        	</p:tab>
        	<p:tab title="Ecursione selezionata">
        		<h:panelGrid columns="2" cellpadding="10"> 
        			<p:graphicImage width="300px" value="images/excursions/#{friendBean.pack.excursion.id}.jpg" /> 
				    <h:panelGrid columns="1">
				        <h2><h:outputText value="#{friendBean.pack.excursion.name}" /></h2>
        				<h:outputText value="#{friendBean.pack.excursion.description}" />
        			</h:panelGrid>  
			    </h:panelGrid>	
        	</p:tab>
        	<p:tab title="Voli selezionati">
        		<table cellpadding="10px">
        			<tr>
						<td>Volo di andata:</td>
						<td>
							Compagnia aerea #{friendBean.pack.suggestedFlight1.company}<br/>
							Partenza dall'aeroporto #{friendBean.pack.suggestedFlight1.airport1.name} di #{friendBean.pack.suggestedFlight1.airport1.location.name} in data
							<h:outputText value="#{friendBean.pack.suggestedFlight1.departureTime}" >
								<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
							</h:outputText><br />
							Arrivo all'aeroporto #{friendBean.pack.suggestedFlight1.airport2.name} di #{friendBean.pack.suggestedFlight1.airport2.location.name} in data
							<h:outputText value="#{friendBean.pack.suggestedFlight1.landingTime}" >
								<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
							</h:outputText><br />
						</td>
					</tr>
					<tr>
						<td>Volo di ritorno:</td>
						<td>
							Compagnia aerea #{friendBean.pack.suggestedFlight2.company}<br/>
							Partenza dall'aeroporto #{friendBean.pack.suggestedFlight2.airport1.name} di #{friendBean.pack.suggestedFlight2.airport2.location.name} in data
							<h:outputText value="#{friendBean.pack.suggestedFlight2.departureTime}" >
								<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
							</h:outputText><br />
							Arrivo all'aeroporto #{friendBean.pack.suggestedFlight2.airport2.name} di #{friendBean.pack.suggestedFlight2.airport2.location.name} in data
							<h:outputText value="#{friendBean.pack.suggestedFlight2.landingTime}" >
								<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
							</h:outputText><br />
						</td>
					</tr>
        		</table>
        	</p:tab>
        </p:tabView>
        <br />
        <p>
        	Questo è il pacchetto condiviso dal tuo amico. Se ti interessa prenotarlo anche tu, clicca su "Accedi": potrai anche personalizzarlo a tuo piacere e modificarne gli elementi! Se invece non sei iscritto a Traveldream, clicca su "Registrati".
        </p>
        <center>
        	<p:button outcome="friendCode" value="Indietro" />
        	<p:button outcome="users/friendCode" value="Accedi" />
        	<p:button outcome="registration" value="Registrati" />
        </center>
        
	</p:fieldset>  
	<br /><br />	
	
	</ui:define>
</ui:composition>
</html>